/*
 Copyright 2007 Ole Rogeberg

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
package org.lifeyears.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

import org.hibernate.validator.Length;

/**
 * An entity representing a humanitarian project.
 * 
 * @author Aleksander Blomskøld
 */
@Entity
public class Project
    extends AbstractEternalEntity
{
    @ManyToOne( optional = false )
    private Organization organization;

    @Column( nullable = false, unique = true )
    @Length( min = 2, max = 50 )
    private String name;

    // a _short_ XHTML-description of the project
    @Column( nullable = false )
    @Lob
    private String shortDescription;

    // An XHTML-descrioption of the project
    @Column( nullable = false )
    @Lob
    private String description;

    // URL to a web-page hosted by the Organization, describing this project
    private String homePage;

    // the price per lifeyear
    private int pricePerLifeyear;

    public Organization getOrganization()
    {
        return organization;
    }

    public void setOrganization( final Organization organization )
    {
        this.organization = organization;
    }

    public String getName()
    {
        return name;
    }

    public void setName( final String name )
    {
        this.name = name;
    }

    public String getShortDescription()
    {
        return shortDescription;
    }

    public void setShortDescription( final String shortDescription )
    {
        this.shortDescription = shortDescription;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription( final String description )
    {
        this.description = description;
    }

    public String getHomePage()
    {
        return homePage;
    }

    public void setHomePage( final String homePage )
    {
        this.homePage = homePage;
    }

    public int getPricePerLifeyear()
    {
        return pricePerLifeyear;
    }

    public void setPricePerLifeyear( final int pricePerLifeyear )
    {
        this.pricePerLifeyear = pricePerLifeyear;
    }
}
